Note: There are often multiple ways to answer each question.

  1. Assign the character string “11” to x and the character string “22” to y.

  2. What is the result of x + y? Why does R return this result?

  3. If we wanted to treat the contents of x and y as numbers and add them, how could we do that?

  4. Save the (numeric) result from Qn 3 in the variable z. Compute the square root of z.

  5. Remove all the variables that you have created from the environment.

  6. Your friend Jack wants to print the string “STATS_32” to the console. He enters the following command but encounters an error. What went wrong? What should he have done instead?

print(STATS_32)
## Error in print(STATS_32): object 'STATS_32' not found
  1. What is the result of NA + 2? Why do you think that is?